package com.ceair.flight.refund.location.dt.enums;

/**
 * 退票状态枚举
 *
 * @author youguilin
 */
public enum RefundStatusEnum {
    SUBMIT_APPLY("101", "提交申请"),
    REFUND_TICKET_EXCEPTION("109", "退票异常"),
    WAIT_FIRST_AUDIT("201", "等待审核"),
    WAIT_USER_UPDATE("2011", "等待用户更新"),
    FIRST_AUDIT_EXCEPTION("209", "一审异常"),
    WAIT_SECOND_AUDIT("301", "等待二审"),
    SECOND_AUDIT_REFUSE("3011", "等待审核(二审拒绝)"),
    SECOND_AUDIT_PASS("302", "二审通过"),
    WAITING_CARD_FOR_REFUND_NO("308", "等待用户支付卡信息生成退票单号"),
    GENERATE_REFUND_NO_EXCEPTION("309", "生成退票单号异常"),
    WAIT_MONEY_REFUND("401", "等待退款"),
    MONEY_REFUNDING("402", "退款中"),
    MONEY_REFUND_EXCEPTION("409", "退款异常"),
    MONEY_REFUND_SUCCESS("501", "退款成功"),
    REFUNDED_DONE("901", "退票完成"),
    DELETED("909", "已删除");

    /**
     * 简码
     */
    private final String code;

    /**
     * 描述
     */
    private final String description;

    private RefundStatusEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * @return Returns the code.
     */
    public String getCode() {
        return code;
    }

    /**
     * @return Returns the description.
     */
    public String getDescription() {
        return description;
    }

    /**
     * 通过枚举<code>code</code>获得枚举。
     *
     * @param code 简码
     * @return 枚举
     */
    public static RefundStatusEnum getByCode(String code) {
        for (RefundStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
